<!DOCTYPE html>
<html>
<head>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">

</head>

<body>

系统载入中，请稍等...

<?php
//验证登陆信息
session_start();

include_once("../config.php");
include_once '../connection.php';


$account = $_POST['account'];
$email = $_POST['email'];


if (!preg_match("/^[0-9a-zA-Z]{3,12}$/", $account)) {echo "<script language='javascript'>alert('非法用户名！');location='resetpass_send.php';</script>";}
if(!filter_var($email, FILTER_VALIDATE_EMAIL)){echo "<script language='javascript'>alert('邮箱格式不正确！');location='resetpass_send.php';</script>";}


$table = $table_Prefix."company";
$query = mysql_query("SELECT nid FROM $table where account ='$account' and email = '$email'");
$company_nid = mysql_result($query, 0);
mysql_close($con);
if($company_nid){
    $_SESSION['resetpassword_id'] = $company_nid;
    $yzm = str_pad(mt_rand(10, 999999), 6, "0", STR_PAD_BOTH);
    $_SESSION['resetpassword_yzm'] = $yzm;

    include_once (ROOT_PATH_."/application/mailbox/send_user_pass.php");

    //启动函数
    send_mail($email,$yzm);

    echo '<script type="text/javascript">alert("验证码已发送到邮箱，点击进行下一步操作");document.location.href = "resetpass.php";</script>';

}else{
    echo '<script type="text/javascript">alert("账号或者邮箱不存在，点击确认返回继续操作.");document.location.href = "resetpass_send.php";</script>';
}

?>
</body>